package com.coupons.business.common.vo.decorator;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.coupons.business.common.vo.Merchant;

public class MerchantRowMapper implements RowMapper {

	public Object mapRow(ResultSet objaResultSet, int index) throws SQLException {
		
		Merchant objlMerchant =  new Merchant();
		
		objlMerchant.setMerchantId(objaResultSet.getInt("mrchnt_id"));
		objlMerchant.setMerchantName(objaResultSet.getString("mrchnt_name"));
		objlMerchant.setPartnerId(objaResultSet.getInt("partner_id"));
		objlMerchant.setDescription(objaResultSet.getString("Description"));
		objlMerchant.setCreationDate(objaResultSet.getDate("crtn_dt"));
		objlMerchant.setLastUpdatedDate(objaResultSet.getDate("last_updt_dt"));
		objlMerchant.setStatus(objaResultSet.getString("status"));
		objlMerchant.setLicenseEndDate(objaResultSet.getDate("lcsn_end_dt"));
		objlMerchant.setLastUpdatedUser(objaResultSet.getString("last_udt_user"));
		objlMerchant.setRank(objaResultSet.getInt("rank"));
		objlMerchant.setMerchantOfferHeader(objaResultSet.getString("Merchant_Offer_Header"));
		objlMerchant.setMerchantSiteURL(objaResultSet.getString("Merchant_Site_URL"));
		objlMerchant.setMerchantEmblem(objaResultSet.getString("Merchant_Emblem"));
		objlMerchant.setMerchantAssociationId(objaResultSet.getString("Merchant_association_id"));
		
		return objlMerchant;		
	}
}
